/*
cli_cmd.h
cil_cmd.c headfile,offer uart debug port function
designed by lunanting
----------------------
2020-03-20 17:13:30
creat file
---------------------

*/
#ifndef __CLI_CMD_H
#define __CLI_CMD_H

#include "aos/cli.h"
#include "base_type.h"
#include "string.h"

#define __FN__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
// #define println(format, args...) printo("%s %d: %s() "format,__FN__,__LINE__,__func__,##args)
#define println(format, args...) printo("%s [%d]: "format"\r\n",__FN__,__LINE__,##args)
#define perr(format,  args...) printo("ERROR: %s %d: "format"\r\n",__FN__,__LINE__,##args)



/*******************************define************************/
#define pSize 200
#define TIME_file   24*3600*1000-1


/*************************function extern**********************/
extern void xp_cli_init(void);   //xp cli cmd debug init
extern void printo(const char *str,...); //debug port print string with enter
extern void print_up_log(const char *str,...);
extern void print(const char *str,...); //debug port print string 
extern void print_buf(const void *data,const u8 len,const u8 data_w,const u8 type); //printf buffer
extern int xp_cli_debug_add(int (*api)(char *,char *,char *));  //add debug api
extern void xp_wellcome_worlds(char *app,char *version);    //wellcome worlds
// extern int xp_log_init(void);   //log init
extern void xp_cli_cmd_set(char *ty,char *fu,char *pa); //set cmd 
extern void xp_cli_tcp_print_regist(void (*print_api)(void *,char *),void *server); //tcp print regist
extern void xp_logHold_check(void); //check log hold file
extern void xp_logHoldDays_set(int days);   //set log file hold days
extern void xp_logList_show(void);  //show log file list
extern void xp_logSwitch_set(int sta);  //log recode switch set

extern void xp_mqtt_send_log_callback_regist(int (*callback)(char *arg));
extern void set_log_upload_flag(bool enable);

#endif


//end of the file
